//
//  PushHotCell.m
//  HYHOME
//
//  Created by cjy on 16/2/28.
//  Copyright © 2016年 Mac. All rights reserved.
//

#import "PushHotCell.h"
#import "HotModel.h"
#import "UIImageView+WebCache.h"
#import "DKNightVersion.h"
@implementation PushHotCell
- (void)dealloc{

    [_detail release];
    [super dealloc];

}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.dk_backgroundColorPicker = DKColorWithRGB(0xffffff, 0x343434);

        [self createSubView];
        
    }

    return self;
}

- (void)createSubView{

    self.detail = [[UIImageView alloc]init];
    [self.contentView addSubview:self.detail];
    

    [self.detail release];
}

+ (CGFloat)heightForLabel:(NSString *)text{
    
    CGRect rect = [text boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width - 40, 0) options: NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil];
    return rect.size.height;
}

+ (CGFloat)heightForCell:(NSString *)model{
    
    CGFloat height =  [PushHotCell heightForLabel:model];
    
    
    return height;
    
}

- (void)layoutSubviews{

    [super layoutSubviews];
    
    
    
    self.detail.frame = CGRectMake(0, 10, self.contentView.frame.size.width, 200);
     
    self.detail.dk_backgroundColorPicker =  DKColorWithRGB(0xffffff, 0xb8b8b8);




}

- (void)passModel:(NSString *)model{
 
    
  
  [self.detail sd_setImageWithURL:[NSURL URLWithString:model] placeholderImage:[UIImage imageNamed:@"jz"]];
        
 
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
